<template>
  <div>
    <div v-show="userList.length > 0" v-for="(item, index) in userList" :key="index" class="user-list">
      <div>
        <div class="avatar-img">
          {{ item.realName.slice(0, 2) }}
        </div>
      </div>
      <div class="avatar-name">{{ item.realName }}</div>
    </div>
    <div class="user-list">
      <div v-if="userList.length > 5">
        <div>
          <div class="avatar-img" style="margin-left: 4px">
            <img src="./img/look-all.png" height="25px" alt="查看全部" />
          </div>
        </div>
        <div class="avatar-name" style="width: 50px">查看更多</div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    userList: {
      type: Array,
      default: [],
    },
  },
  data() {
    return {
      userListFir: this.userList.length > 5 ? this.userList.slice(0, 5) : this.userList,
    }
  },
}
</script>
<style lang="less">
.user-list {
  float: left;
  width: 50px;
  margin: 5px;
  text-align: center;
  .avatar-img {
    justify-content: center;
    background: #2196f3;
    height: 40px;
    border-radius: 8px;
    width: 40px;
    text-align: center;
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 12px;
  }
  .avatar-name {
    justify-content: center;
    height: 25px;
    width: 40px;
    text-align: center;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    color: rgb(143, 143, 143);
    font-size: 12px;
  }
}
</style>